    function shownavigate ()
    {
        if (pagecount<=1)
            return;
        var i=0;
        var navtable="";
        if (pagecount<=10)
        {
            for (i=1;i<=pagecount;i++)
            {
                if (i!=currentpage)
                    navtable+="<a href='javascript:showresult("+i+")'>"+i+"</a> ";
                else
                    navtable+=""+i+" ";
            }
            document.getElementById("navigate").innerHTML=navtable;
            return;
        }
        if (pagecount>10)
        {
            if (currentpage>1)
                navtable+="<a href='javascript:showresult(1);'>first</a> ";
            if (currentpage>2)
                navtable+="<a href='javascript:showresult("+(currentpage-1)+")'>pre</a> ";
            if (currentpage<6)
            {
                for(i=1;i<10;i++)
                {
                    if(i!=currentpage)
                        navtable+="<a href='javascript:showresult("+i+")'>"+i+"</a>";
                    else
                        navtable+=""+i+" ";
                }
            }
            else
            {
                for(i=currentpage-4;i<currentpage+5;i++)
                {
                    if(i!=currentpage)
                        navtable+="<a href='javascript:showresult("+i+")'>"+i+"</a>";
                    else
                        navtable+=""+i+" ";
                }
            }
            if (currentpage<pagecount-1)
                navtable+="...";
            if (currentpage<pagecount-2)
                navtable+="<a href='javascript:showresult("+(currentpage+1)+");'>first</a> ";
            if (currentpage<pagecount-1)
                navtable+="<a href='javascript:showresult("+pagecount+")'>last</a> ";
        }
        document.getElementById("navigate").innerHTML=navtable;
    };
    function showresult (page){
        var resulttable="";
        resulttable="<table>\n<tr>";
        resulttable+="<td>id</td>";
        resulttable+="<td>username</td>";
        resulttable+="<td>nickname</td>";
        resulttable+="<td>description</td>";
        resulttable+="<td>E-mail</td>";
        resulttable+="<td>country</td>";
        resulttable+="<td>address</td>";
        resulttable+="<td>Tel</td>";
        resulttable+="<td>BirthDate</td>";
        resulttable+="<td>userrole</td>";
        resulttable+="</tr>\n";
        var i=0;
        for (i=(page-1)*pagesize;i<page*pagesize;i++)
        {	
            if (i<resultcount)
            {
                resulttable+="<tr>";
                resulttable+="<td>"+users[i][0]+"</td>";
                resulttable+="<td>"+users[i][1]+"</td>";
	            resulttable+="<td>"+users[i][2]+"</td>";
	            resulttable+="<td>"+users[i][3]+"</td>";
            	resulttable+="<td>"+users[i][4]+"</td>";
            	resulttable+="<td>"+users[i][5]+"</td>";
            	resulttable+="<td>"+users[i][6]+"</td>";
            	resulttable+="<td>"+users[i][7]+"</td>";
            	resulttable+="<td>"+users[i][8]+"</td>";
            	resulttable+="<td>"+users[i][9]+"</td>";
            	resulttable+="</tr>\n";
            }
            else
            {
                resulttable+="<tr>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
                resulttable+="<td></td>";
            	resulttable+="</tr>\n";
            }
        }
        resulttable+="</table>\n";            
        document.getElementById("result").innerHTML=resulttable;
        currentpage=page;
        shownavigate();
    };